import Cesium from '@/views/test/Cesium.vue'
import Map from '@/views/test/Map.vue'
import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {  
    path: '/',  
    redirect: '/home', // 重定向到不带斜杠的home  
  },
  {
    path: '/cesium',
    component: Cesium
  },
  {
    path: '/beam3d',
    component: () => import('@/views/test/Beam3D.vue')
  },
  {
    path: '/beam',
    component: () => import('@/views/test/Beam.vue')
  },
  {
    path: '/boat',
    component: () => import('@/views/test/Boat.vue')
  },
  {
    path: '/map',
    component: () => import('@/views/Back'),
    children: [
      {
        path: '',
        component: Map
      }
    ]
  },
  {  
    path: '/home', // 主路由路径不带斜杠  
    component: () => import('@/views/Home'),  
  },
  // {  
  //   path: '/home', // 主路由路径不带斜杠  
  //   component: () => import('@/views/Back'),  
  //   children: [  
  //     {  
  //       path: '', // 子路由路径是相对于父路由的，不带斜杠  
  //       component: () => import('@/views/Home'),
  //     }
  //   ]  
  // },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
